package com.example.demo.service.impl;

import com.example.demo.mapper.PreservationMapper;
import com.example.demo.pojo.Preservation;
import com.example.demo.pojo.request.PreservationRequest;
import com.example.demo.service.PreservationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 程序员小洋
 * @version 2022.3
 * @date 2023/5/9 09:16
 * @title 项目维护表的业务实现类
 */
@SuppressWarnings("all")
@Service
public class PreservationServiceImpl implements PreservationService {

    @Autowired
    private PreservationMapper preservationMapper;

    /**
     * 新增
     * @param preservation
     * @return
     */
    @Override
    public void save(Preservation preservation) {
        preservationMapper.save(preservation);
    }

    /**
     * 修改
     * @param preservation
     * @return
     */
    @Override
    public void update(Preservation preservation) {
        preservationMapper.update(preservation);
    }

    /**
     * 根据id删除
     * @param id
     */
    @Override
    public void deleteById(Integer id) {
        preservationMapper.deleteById(id);
    }

    /**
     * 根据id查询
     * @param id
     * @return
     */
    @Override
    public Preservation getById(Integer id) {
        return preservationMapper.getById(id);
    }

    /**
     * 条件查询
     * @return
     */
    @Override
    public List<Preservation> list(PreservationRequest preservationRequest) {
        return preservationMapper.list(preservationRequest);
    }


}
